package com.bawei.mvc.View;

import android.os.Bundle;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bawei.mvc.Pertion.BasePresenter;

/**
 * create by ertu
 * create on 2021/7/18
 * description
 */
public abstract class BaseActivity <P extends BasePresenter > extends AppCompatActivity implements IActivity,IView {

    protected P mpresenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(bandLayouts());
        initViews();
        initDates();
    }

    @Override
    public void showLaoding() {

    }

    @Override
    public void showToast(String msg) {
        Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
    }

    @Override
    public void hideLaoding() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mpresenter!=null)
        {
            mpresenter.dinst();
        }
    }
}
